home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / games / texturemapping / text.asm < prev    next >
Assembly Source File  |  1980-01-03  |  1KB  |  56 lines

  1. ; $$TABS=8
  2. ; text plotting routines for demo
  3.  
  4.     include    'demo.i'
  5.     include    'graphics/rastport.i'
  6.  
  7.     xref    _SysBase,_LVORawDoFmt,_LVOMove,_LVOText,_LVOSetABPenDrMd
  8.     xref    canvas_rport,_GfxBase
  9.  
  10. PlotString::
  11. ; PlotString - plot a string (and potentially two numbers)
  12. ; input 4(a7)=numbers to be printed
  13. ;    a0=c style format string
  14. ;    d2/d3=xy coords
  15. ; trashes: d2/d3/d0/d1/a0/a1
  16.     movem.l    a5/a2/a3,-(a7)
  17.     move.l    a6,a5
  18.     lea    16(a7),a1        ; pointer to passed args
  19.     clr.l    TextLength(a5)
  20.     lea    MyPutChProc(pc),a2
  21.     lea    TextBuffer(pc),a3
  22.     move.l    _SysBase(a6),a6
  23.     jsr    _LVORawDoFmt(a6)
  24.     lea    canvas_rport(a5),a1
  25.     move.l    _GfxBase(a5),a6
  26.     move.l    d2,d0
  27.     move.l    d3,d1
  28.     jsr    _LVOMove(a6)
  29.     lea    canvas_rport(a5),a1
  30.     moveq    #31,d0    ; apen
  31.     moveq    #0,d1    ; bpen
  32.     move.l    #RP_JAM2,d2
  33.     jsr    _LVOSetABPenDrMd(a6)    ; doesn't do anything if nothing changed.
  34.     lea    canvas_rport(a5),a1
  35.     lea    TextBuffer(pc),a0
  36.     move.l    TextLength(a5),d0
  37.     subq.l    #1,d0            ; subtract off trailing null
  38.     jsr    _LVOText(a6)
  39.     move.l    a5,a6
  40.     movem.l    (a7)+,a5/a2/a3
  41.     rts
  42.  
  43. MyPutChProc:
  44.     addq.l    #1,TextLength
  45.     move.b    d0,(a3)+
  46.     rts
  47.  
  48.  
  49. TextBuffer:
  50.     ds.b    80
  51.  
  52.  
  53.     section    __MERGED,data
  54. TextLength::
  55.     dc.l    0
  56.